def calculate_expression(a, b, c):
    """计算表达式 (a + b + c) * c 的值"""
    return (a + b + c) * c


def get_valid_integer(prompt):
    """获取有效的整数输入"""
    while True:
        try:
            value = int(input(prompt))
            return value
        except ValueError:
            print("错误：请输入有效的整数！")


def main():
    try:
        # 获取输入并验证
        a = get_valid_integer("请输入整数a：")
        b = get_valid_integer("请输入整数b：")
        c = get_valid_integer("请输入整数c：")

        # 执行计算
        result = calculate_expression(a, b, c)

        # 输出结果
        print(f"计算结果：{result}")

    except KeyboardInterrupt:
        print("\n操作被用户中断")
    except Exception as e:
        print(f"发生未知错误：{str(e)}")


if __name__ == "__main__":
    main()